import command.Zh0202CloseCommand;
import command.Zh0202OpenCommand;
import electricalequipment.*;

/**
 * @author: zh
 * @date: 2021/11/18 11:30
 * @version: 1.0
 */
public class Client {
    public static void main(String[] args) {
        Zh0202ElectricalEquipment equipment1 = new Zh0202AirConditione();
        Zh0202ElectricalEquipment composite = new Zh0202Composite();
        composite.add(equipment1);
        Zh0202OpenCommand openCommand = new Zh0202OpenCommand(composite);
        Zh0202CloseCommand closeCommand = new Zh0202CloseCommand(composite);
        openCommand.execute();
        closeCommand.execute();
        System.out.println("-------------------------------------------");
        Zh0202ElectricalEquipment equipment2 = new Zh0202Light();
        composite.add(equipment2);
        Zh0202OpenCommand openCommand2 = new Zh0202OpenCommand(composite);
        Zh0202CloseCommand closeCommand2 = new Zh0202CloseCommand(composite);
        openCommand2.execute();
        closeCommand2.execute();
        System.out.println("-------------------------------------------");
        Zh0202ElectricalEquipment equipment3 = new Zh0202Fan();
        composite.add(equipment3);
        Zh0202OpenCommand openCommand3 = new Zh0202OpenCommand(composite);
        Zh0202CloseCommand closeCommand3 = new Zh0202CloseCommand(composite);
        openCommand3.execute();
        closeCommand3.execute();
        System.out.println("-------------------------------------------");
        Zh0202ElectricalEquipment equipment4 = new Zh0202MultiMedia();
        composite.add(equipment4);
        Zh0202OpenCommand openCommand4 = new Zh0202OpenCommand(composite);
        Zh0202CloseCommand closeCommand4 = new Zh0202CloseCommand(composite);
        openCommand4.execute();
        closeCommand4.execute();
        System.out.println("-------------------------------------------");
    }
}
